<template>
  <div class="container">
    <topTitle
      :titleText="`工资专户`"
      :back="back"
      @gobackTriser="goBack"
    ></topTitle>
    <!-- <el-row class="topContent">
      <el-col :span="16">
        <div>
          <span class="titleTop">
            <i class="icon iconfont iconfanhui1" @click="goback"></i>
            工资专户
          </span>
        </div>
      </el-col>
      <el-col :span="8" class="alignRight">
      </el-col>
    </el-row> -->
    <czSalarySpecialAccount
      ref="salarySpecialAccount"
      :projectId="projectId"
      :accountCode="accountCode"
      :bankId="bankId"
    ></czSalarySpecialAccount>
  </div>
</template>

<script>
import czSalarySpecialAccount from '@/components/specialAccount/czSalarySpecialAccount'
export default {
  name: 'czCompanyAccountDetail',
  components: {
    czSalarySpecialAccount,
  },
  data() {
    return {
      isShowBtn: true,
      projectId: '',
      accountCode: '',
      bankId: '',
      isShowUpdate: '',
      path: '', //跳转过来的路径
    }
  },
  created() {
    this.projectId = this.$route.query.projectId
    this.accountCode = this.$route.query.account
    this.bankId = this.$route.query.bankId
    this.path = this.$route.query.path
    this.isShowUpdate =
      this.$store.state.buttonLimitsArr.indexOf('accountList:update') > -1
  },
  mounted() {},
  methods: {
    goback() {
      //从项目详情页面-管理专户跳转过来的
      if (this.path === 'projectListQY') {
        this.$router.push('/home/companyProjectManage/projectDetailQY')
        this.$store.commit('CHANGE_SLIDER_NAME', {
          oldUrl: '/home/companyProjectManage/projectDetailQY',
          newUrl: this.$router.currentRoute.fullPath,
        })
      }
      //从专户列表跳转过来的
      if (this.path === 'specialAccountList') {
        this.$router.push('/home/specialAccount/specialAccountList')
        this.$store.commit('CHANGE_SLIDER_NAME', {
          oldUrl: '/home/specialAccount/specialAccountList',
          newUrl: this.$router.currentRoute.fullPath,
        })
      }
      //从滁州专户列表跳转过来的
      if (this.path === 'specialAccount') {
        this.$router.push('/home/separateAccountManagement/specialAccount')
        this.$store.commit('CHANGE_SLIDER_NAME', {
          oldUrl: '/home/separateAccountManagement/specialAccount',
          newUrl: this.$router.currentRoute.fullPath,
        })
      }
      if (this.path === 'esSpecialAccountList') {
        this.$router.push('/home/enShiCustomRequirements/esSpecialAccountList')
        this.$store.commit('CHANGE_SLIDER_NAME', {
          oldUrl: '/home/enShiCustomRequirements/esSpecialAccountList',
          newUrl: this.$router.currentRoute.fullPath,
        })
      }
      // 鹤峰流水回传
      if (this.path === 'hfManualPostback') {
        this.$router.push('/home/enShiCustomRequirements/hfManualPostback')
        this.$store.commit('CHANGE_SLIDER_NAME', {
          oldUrl: '/home/enShiCustomRequirements/hfManualPostback',
          newUrl: this.$router.currentRoute.fullPath,
        })
      }
      if (this.path === 'czSpecialAccountList') {
        this.$router.push('/home/specialAccount/czSpecialAccountList')
        this.$store.commit('GOBACK_NAME', {
          oldUrl: '/home/specialAccount/czSpecialAccountList',
          newUrl: this.$router.currentRoute.fullPath,
        })
      }
    },
    //若调用子组件里b方法
    toUpdate() {
      this.$refs.salarySpecialAccount.updateAccount()
    },
  },
}
</script>

<style scoped lang="less">
.container {
  .topContent {
    background: #e4ebf1;
    height: 67px;
    line-height: 40px;
    padding: 15px 24px;
    .titleTop {
      font: bold 18px Microsoft YaHei;
      color: #333333;
    }
    .alignRight {
      text-align: right;
    }
    .createSalaryBut {
      background: #009588;
      border: 1px solid #009588;
      padding: 9px 23px;
      &:hover {
        opacity: 0.8;
      }
    }
  }
}
</style>
